dofile "extern_libs4.lua"
	solution "SDLWabbitemu"
		configurations {"Debug", "Release"}
		location "../build" -- optional, but cleaner
		targetdir "../bin"  -- optional, same here
		extern_libs = { "sdl" }
		configuration "Debug"
			defines { "DEBUG" }
			flags { "Symbols", "ExtraWarnings" }
		configuration "Release"
			flags { "Optimize" }
		
		configuration { "linux", "gmake" }
			buildoptions { "-x c++" }
		
		-- Thanks to the 0ad project for this amazing macro!
		-- https://github.com/0ad/0ad/
		project_add_extern_libs({"sdl"})
		
		project "SDLWabbitemu"
			kind "WindowedApp"
			language "C++"
			
			includedirs {
				"..",
				"../core",
				"../debugger",
				"../gui",
				"../hardware",
				"../interface",
				"../utilities"
			}
			defines {
				"HIGH_SHADE_GIF",
				"VERBOSE",
				"_LINUX",
			}
			files {
				-- Core
				"../core/core.c",
				"../core/alu.c",
				"../core/control.c",
				"../core/device.c",
				"../core/indexcb.c",
				-- Calc Interfacing
				"../interface/calc.c",
				"../interface/state.c",
				-- Utilities/Libraries
				"../utilities/exportvar.c",
				"../utilities/fileutilities.c",
				"../utilities/gif.c",
				"../utilities/gifhandle.c",
				"../utilities/label.c",
				"../utilities/savestate.c",
				"../utilities/sendfile.c",
				"../utilities/var.c",
				-- Hardware Emulation
				"../hardware/81hw.c",
				"../hardware/83hw.c",
				"../hardware/83phw.c",
				"../hardware/83psehw.c",
				"../hardware/86hw.c",
				"../hardware/keys.c",
				"../hardware/lcd.c",
				"../hardware/link.c",
				-- SDL GUI
				"../gui/gui_sdl.c", -- This requires ../gui/gui_sdl.h
				"../gui/guilcd_sdl.c", -- This requires ../gui/guilcd_sdl.h
				"../gui/gui_sdl_emu.c", -- This requires ../gui/gui_sdl_emu.h
			}

newaction {
	trigger		= "install",
	description	= "Install wxWabbitemu",
	execute		= function ()
				os.copyfile("bin/wxwabbitemu", "/usr/bin/wxwabbitemu")
			end
}
